package service

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type RedirectService struct {
	C              *gin.Context
	BeforeRedirect func(c *gin.Context)
}

func (service *RedirectService) Redirect(url string) {
	service.BeforeRedirect(service.C)
	service.C.Redirect(http.StatusMovedPermanently, url)
}
